import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
 * Common super class for various lexical elements.
 */
public class TextElement
{
    /**
     * Original number on current level.
     */
    public String id;

    /**
     * Parent link.
     */
    public TextElement parent;

    /**
     * Source DOM element.
     */
    public Element element;

    /**
     * Source DOM document;
     */
    public Document document;

    /**
     * Indicates whether to save DOM structure.
     * Needed to write changes back to XML files.
     */
    public static boolean flagModifyDOM = false;

    /**
     * Returns full path to the element.
     */
    public String GetFullID()
    {
        if (parent == null)
            return id + ":";
        else
            return parent.GetFullID() + " " + id + ":";
    }
}
